﻿using System;
namespace GX
{
    public interface INetManager : IDisposable
    {

        bool isConnected { get; }

        void Connect(string ip, int port);
        void Disconnect(bool reuseSocket = true);
        bool IsSameSocket(string ip, int port);
        void AddNetHandler(INetHandler handler);
        void RemoveNetHandler(ushort code);

        IPackageOut GetPkgOut(byte frame, byte way);
        void Send(IPackageOut pkg);
        void Recieve();
    }
}